<?php

namespace App\HttpController\Api;

use EasySwoole\Core\Http\AbstractInterface\Controller;

/**
 * Class Index
 * @package App\HttpController
 */
class Base extends Controller
{
    /**
     * 首页方法
     * @author : evalor <master@evalor.cn>
     */
   public function index()
   {

    }

    /**
     * @param $action
     * @return bool|null
     */

    public function onRequest($action):?bool
    {
        //$this->writeJson(403,'你没有权限访问',[]);
        return true;
    }

    /**
     * @param \Throwable $throwable
     * @param $actionName
     * @throws \Throwable
     */
    public function onException(\Throwable $throwable,$actionName):void
    {
      $this->writeJson('400','请求不合法',[]);
    }

}